import Vue from "vue"
import Vuex from "vuex"
Vue.use(Vuex)
export const store = new Vuex.Store({
  state: {
    address: {},
    subjectindex: "", // 当前选中的学科
    keshiindex: "", // 当前选中的课时
    week: '', // 预约周几
    keshiid: "", //课时的id
    teacher_setup_id: "", // 预约的课时id
    test: "", // 测试u
    userinfo: {} // 用户信息
  },
  mutations: {

    // 测试
    testfn(state, value) {
      state.test = value
    },
    // 保存地址
    saveaddress(state, obj) {
      state.address = obj
    },
    // 保存当前选中的学科
    savesubject(state, obj) {
      state.subjectindex = obj
    },
    // 保存当前选中的课时
    savekeshi(state, value) {

      state.keshiindex = value

    },
    // 保存当前的选中的周几
    saveweek(state, value) {
      state.week = value
    },
    // 保存预约的课时数量
    savesubjectnum(state, value) {
      state.teacher_setup_id = value
    },
    // 保存课时的id
    savekeshiid(state, value) {
      state.keshiid = value

    }

  }
})